package com.hulk.dryad.manage.framework.ftp.config;

import com.hulk.dryad.manage.framework.ftp.template.FtpTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 文件系统服务自动配置
 *
 * @author hulk
 */
@Configuration
@ConditionalOnProperty(name = "enabled", prefix = FtpProperties.PREFIX, havingValue = "true")
@EnableConfigurationProperties(FtpProperties.class)
public class FtpClientAutoConfiguration {


	@Bean
	@ConditionalOnMissingBean(FtpTemplate.class)
	public FtpTemplate ftpTemplate(FtpProperties properties) {
		return new FtpTemplate(properties);
	}




}
